package com.channelsoft.cm.application;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;

public class ClientCheckActivity extends Activity {
	private EditText edit_phoneno;
	private ImageButton btn_sendcode;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.clientcheck);
		edit_phoneno = (EditText) this.findViewById(R.id.edit_phoneno);
		btn_sendcode = (ImageButton) this.findViewById(R.id.btn_sendcode);
	}

	public void sendcode(View v) {

		String phoneNum = edit_phoneno.getText().toString();
		if (phoneNum == null || "".equals(phoneNum)) {
			Toast.makeText(this, "请输入正确的手机号码!", Toast.LENGTH_LONG).show();
		} else {
			// 发送phoneNum去服务端验证
			// 提交验证时需要改变按钮的状态为不可点击,以免重复提交
			// btn_sendcode.setClickable(false);
			if ("15437896322".equals(phoneNum)) {
				ClientCheckActivity.this.startActivity(new Intent(
						ClientCheckActivity.this, ClientReCheckActivity.class));
				this.finish();
			}
		}

	}

}
